(defun C:FIXBY ()
  (setq dir_str (strcat "dir U:/LSP/*.lsp /b > U:/LSP/lsp_file.dat"))
  (command "_sh" dir_str)
  (graphscr)
  (set_file_list)
);defun
(defun set_file_list ( / )
  (setq ff_name (findfile "U:\\LSP\\LSP_FILE.DAT"))
  (if ff_name
    (setq llst_file (open ff_name "r"))
  );if
  (setq lsp_file_list nil)
  (if llst_file
    (progn
      (while (setq fs_str (read-line llst_file))
        (setq lsp_file_list
          (if lsp_file_list
            (append lsp_file_list (list fs_str))
            (list fs_str)
          )
        )
      );while
      (close llst_file)
    (foreach n lsp_file_list
      (if (setq found_file(findfile n))
        (progn
;	  (princ (strcat "\nFixing Byline for " found_file))
          (setq lsp_file (open found_file "r"))
          (setq lsp_desc (read-line lsp_file))
          (if(eq(substr lsp_desc 1 1)";")
            (progn
              (setq file_lines (list lsp_desc))
              (setq line2 (read-line lsp_file))
              (if (eq "(" (substr line2 1 1))
                (setq file_lines
                  (append
                    file_lines
                    (list ";\tAuthor:")
                    (list ";\t\tHenry C. Francis")
                    (list ";\t\t425 N. Ashe St.")
                    (list ";\t\tSouthern Pines, NC 28387")
                    (list ";\thttp://paracadd.com")
                    (list ";\tAll rights reserved.")
                    (list line2)
                  )
                )
                (setq file_lines (append file_lines (list line2)))
              )
              (while (setq nxtline (read-line lsp_file))
                (setq nxtlen (strlen nxtline))
                (cond
                  ((and
                     (> nxtlen 17)
                     (wcmatch nxtline "*http://www.pinehurst.net/~pfrancis*")
                   )
                   (setq nxtline ";;;\thttp://paracadd.com")
                  )
                  ((and
                     (> nxtlen 17)
                     (wcmatch nxtline "*e-mail hfrancis`@pinehurst.net*")
                   )
                   (setq nxtline ";;;")
                  )
                  ((and
                     (> nxtlen 18)
                     (or
                       (eq (substr nxtline (- nxtlen 18)) "C/O 425 N. ASHE ST.")
                       (eq (substr nxtline (- nxtlen 18)) "c/o 425 N. ASHE ST.")
                       (eq (substr nxtline (- nxtlen 18)) "C/o 425 N. ASHE ST.")
                       (eq (substr nxtline (- nxtlen 18)) "C/O 425 N. Ashe St.")
                       (eq (substr nxtline (- nxtlen 18)) "c/o 425 N. Ashe St.")
                       (eq (substr nxtline (- nxtlen 18)) "C/o 425 N. Ashe St.")
                     )
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 19))"425 N. ASHE ST."))
                    )
                  ((and
                     (> nxtlen 19)
                     (or
                       (eq (substr nxtline (- nxtlen 19)) "North Carolina 28387")
                       (eq (substr nxtline (- nxtlen 19)) "NORTH CAROLINA 28387")
                     )
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 20))"NC 28387"))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 26)
                       (or
                         (eq (substr nxtline (- nxtlen 26)) "North Carolina state  28387")
                         (eq (substr nxtline (- nxtlen 26)) "NORTH CAROLINA state  28387")
                       )
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 27))"NC 28387"))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 25)
                       (or
                         (eq (substr nxtline (- nxtlen 25)) "North Carolina state 28387")
                         (eq (substr nxtline (- nxtlen 25)) "NORTH CAROLINA state 28387")
                       )
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 26))"NC 28387"))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 19)
                       (or
                         (eq (substr nxtline (- nxtlen 19)) "North Carolina state")
                         (eq (substr nxtline (- nxtlen 19)) "NORTH CAROLINA state")
                       )
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 20))"NC 28387"))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 20)
                     (eq (substr nxtline (- nxtlen 20)) "North Carolina  28387")
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 21))"NC 28387"))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 13)
                     (or
                       (eq (substr nxtline (- nxtlen 13)) "North Carolina")
                       (eq (substr nxtline (- nxtlen 13)) "NORTH CAROLINA")
                     )
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 14))"NC 28387"))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 21)
                     (or
                       (eq (substr nxtline (- nxtlen 21)) "NON-DOMESTIC P.Z. 28387")
                       (eq (substr nxtline (- nxtlen 21)) "Non-Domestic P.Z. 28387")
                       (eq (substr nxtline (- nxtlen 21)) "Non-domestic P.Z. 28387")
                     )
                   )
                    (setq nxtline (substr nxtline 1 (- nxtlen 22)))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 11)
                     (or
                       (eq (substr nxtline (- nxtlen 11)) "NON-DOMESTIC")
                       (eq (substr nxtline (- nxtlen 11)) "Non-Domestic")
                     )
                   )
                    (setq nxtline (substr nxtline 1 (- nxtlen 13)))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 23)
                     (or
                       (eq (substr nxtline (- nxtlen 23)) "N.C. NON-DOMESTIC, 28387")
                       (eq (substr nxtline (- nxtlen 23)) "N.C. Non-Domestic, 28387")
                     )
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 24))"NC 28387"))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                  ((and
                     (> nxtlen 13)
                     (eq (substr nxtline (- nxtlen 13)) ", U.C.C. 1-207")
                   )
                    (setq nxtline (strcat(substr nxtline 1 (- nxtlen 14))"."))
                    (princ (strcat "\n" found_file " fixed. "))
                    )
                )
                (setq file_lines (append file_lines (list nxtline)))
              );while
              (close lsp_file)
              (setq lisp_out (open found_file "w"))
              (foreach n file_lines
                (write-line n lisp_out)
              )
              (close lisp_out)
;              (princ (strcat found_file " byline fixed. "))
            );progn
            (close lsp_file)
          );if
        );progn
      );if
    );foreach
    );progn
  );if
)